<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 如何让饼图按照比例显示UI呢 */
        /* 伪元素用js操作会非常繁琐 */
        .pie,
        .pie::before {
            display: inline-block;
            width: 0;
            border-radius: 50%;
        }

        .pie {
            position: relative;
            border: solid 75px;
            border-color: #3c7 #3c7 #37c #37c;
            box-sizing: border-box;
            transform: rotate(45deg);
        }

        .pie::before {
            content: '';
            position: absolute;
            border: solid 75px;
            border-color: #37c #37c transparent transparent;
            transform: translate(-50%, -50%);
        }

        .pie.convex::before {
            border-color: transparent transparent #3c7 #3c7;
        }

        .pie.one::before {
            transform: translate(-50%, -50%) rotate(.1turn);
        }

        .pie.two::before {
            transform: translate(-50%, -50%) rotate(.25turn);
        }

        .pie.three::before {
            transform: translate(-50%, -50%) rotate(.5turn);
        }

        .pie.four::before {
            transform: translate(-50%, -50%) rotate(.8turn);
        }
    </style>
</head>

<body>
    <div class="pie one"></div>
    <div class="pie two"></div>
    <div class="pie three"></div>
    <div class="pie convex four"></div>
</body>

</html>